package org.arabidopsis.plantCyc;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * FlexECnumber class to have ECnumber of the format 1.1.1.1 or -.-.-.-
 * checks if correctly formatted at construction time. 
 */
public class FlexECnumber{
	String fourNumbers;
	Pattern ecNumberPattern =
		Pattern.compile("(([(\\d)+[\\-]]).){3}[(\\d)+[\\-]]");
	FlexECnumber(String fourNumbersParam) {
		fourNumbers=fourNumbersParam;
		Matcher matcher =ecNumberPattern.matcher(fourNumbers);
		if (!matcher.find())
			System.out.println("ERROR: ecNumber pattern erroneous");
	}
    public String toString() {
    	return fourNumbers; 
    }

}
